# Contributor: <xmingske@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gsoap
pkgver=2.8.134
pkgrel=0
arch="all"
pkgdesc="Cross-platform C and C++ SDK for SOAP/XML Web services"
license="GPL-2.0-or-later gSOAP-1.3b"
url="https://www.genivia.com/dev.html"
depends_dev="$pkgname-tools=$pkgver-r$pkgrel"
makedepends="autoconf automake bison flex openssl-dev>3 libtool zlib-dev"
subpackages="$pkgname-tools $pkgname-dev"
source="https://prdownloads.sourceforge.net/gsoap2/gsoap_$pkgver.zip
	gsoap-libtool.patch
	musl-fixes.patch
	"
builddir="$srcdir/$pkgname-${pkgver%.*}"

# secfixes:
#   2.8.113-r0:
#     - CVE-2021-21783

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	export CFLAGS="$CFLAGS -D_GNU_SOURCE"
	./configure \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--exec-prefix=/usr \
		--enable-ipv6 \
		--enable-c-locale \
		--disable-static
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

tools() {
	pkgdesc="$pkgdesc (tools)"

	amove usr/bin
}

sha512sums="
d30cb69398544abfd6823baca8d565f85cf40336494d1eacc508ef5d8cc77d868cb2d9659a74a376954a1b6d00c99397b1de536d3f6471f3bba9282f031bded7  gsoap_2.8.134.zip
079bb9191f7c756d8e3d87a48f412ff60ef1190b6a1353cdd7ef54b6ade270152bd628b102332a2fdf7b8bbeeb9c7c387c6741c23d10d4024e691c3b260a9ef4  gsoap-libtool.patch
7184083c2e0dd6975b1272b3fa0426167feb1a5f4fbc8e1ade4212f51097695c2af3b2d585ebe71a6dc35d8a27861a355ec9c000ffbecb87b2e06c36d0826248  musl-fixes.patch
"
